package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.ShenqinBean;
import com.lwj.liwanjia.impl.ShenqinView;
import com.lwj.liwanjia.model.ShenqingModel;

import java.io.File;
import java.util.List;
import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/10/21.
 */

public class ShenqingPrensenter {
    private ShenqinView shenqinView;
    private ShenqingModel shenqingModel;

    public ShenqingPrensenter(ShenqinView shenqinView) {
        this.shenqinView = shenqinView;
        shenqingModel = new ShenqingModel();
    }

    public void shenqingIndent(Map<String, Object> map) {
        if (shenqinView != null) {
            shenqingModel.shenqingIndent(map,new Subscriber<ShenqinBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    shenqinView.showError((Exception) e);
                }

                @Override
                public void onNext(ShenqinBean shenqinBean) {
                    shenqinView.shenqinIndent(shenqinBean);
                }
            });
        }
    }
}
